package tech.xs.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import tech.xs.entity.Department;
import tech.xs.mapper.DepartmentMapper;
import tech.xs.service.DepartmentService;
@Service
public class DepartmentServiceImpl implements DepartmentService {
	@Autowired
	private DepartmentMapper departmentMapper;
	@Override
	public List<Department> getlist(Integer limit, Integer page) {
		// TODO Auto-generated method stub
		return departmentMapper.getlist((limit-1)*page, page);
	}

	@Override
	public Integer getCount() {
		// TODO Auto-generated method stub
		return departmentMapper.getCount();
	}

	@Override
	public boolean delete(Integer id) {
		if (departmentMapper.delete(id)>0) {
			return true;
		} else {
			return false;
		}
	}

	@Override
	public boolean Add(Department d) {
		if (departmentMapper.Add(d)>0) {
			return true;
		} else {
			return false;
		}
	}

	@Override
	public boolean Amend(Department d) {
		if (departmentMapper.Amend(d)>0) {
			return true;
		} else {
			return false;
		}
	}

	@Override
	public List<Department> getSelectId(Integer id) {
		// TODO Auto-generated method stub
		return departmentMapper.getSelectId(id);
	}

}
